package com.linsir.file.service;

import com.linsir.core.service.BaseService;
import com.linsir.file.dto.UploadFileResult;
import com.linsir.file.entity.UploadFile;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @ProjectName: linsir
 * @Package: com.linsir.file.service
 * @ClassName: UploadFileService
 * @Description: 文件上传的接口$
 * @Author:Linsir
 * @CreateDate: 2022/9/15 13:44
 * @UpdateDate: 2022/9/15 13:44
 * @Version: 0.0.1$
 */
public interface UploadFileService extends BaseService<UploadFile> {

    /**
     * 获取指定对象记录关联的上传文件列表
     *
     * @param relObjClass
     * @param relObjId
     * @return
     */
    List<UploadFile> getUploadedFiles(String relObjClass, Object relObjId);

    /**
     * 绑定业务id
     *
     * @param relObjId
     * @param relObjTypeClass
     * @param fileUuidList
     * @throws Exception
     */
    void bindRelObjId(Object relObjId, Class<?> relObjTypeClass, List<String> fileUuidList) throws Exception;

    /**
     * 存储文件
     * @param multipartFile
     * @return
     */
    UploadFileResult upload(MultipartFile multipartFile) throws Exception;

    /**
     * 存贮图片
     * @param multipartFile
     * @return
     */
    UploadFileResult imgUpload(MultipartFile multipartFile);
}
